package com.itheima.clientAndService01;

public class MathClass {
    public static void main(String[] args) {
        //abs 返回一个数的绝对值
        int abs = Math.abs(-5);
        //floor  向下取整
        double floor = Math.floor(0.45);
        //ceil  向上取整
        double ceil = Math.ceil(1.23);
        //round  四舍五入
        long round = Math.round(5.52);
        //max 取两者中的最大值
        int max = Math.max(5, 23);
        //min 取两者中的最小值
        int min = Math.min(24, 10);
        //pow  几（第一个数）的几（第二个数）次方
        double pow = Math.pow(2, 3);
        //random  返回0-1之间的随机数，不包括1
        double random = Math.random();
        System.out.println(abs);
        System.out.println(floor);
        System.out.println(ceil);
        System.out.println(round);
        System.out.println(max);
        System.out.println(min);
        System.out.println(pow);
        System.out.println(random);
        double num = (Math.random() * 9 + 1) * 1000;
        double num1 = Math.floor(num);
        System.out.println(num1);
    }
}
